﻿
package extremefx.i18n {
	/**
	 * @author Marcelo Volmaro
	 */
	internal class CCMath {
		public static function mod(pX:Number, pY:Number):Number {
			return pX - pY * Math.floor(pX/pY);
		}
		
		public static function div(pX:int, pY:int):int {
			return int(Math.floor(Number(pX)/Number(pY)));
		}
		
//		public static function divMod(pX:int, pY:int):Array {
//			var d:int = div(pX, pY);
//			var remainder:int = pX - pY * d;
//			return [d, remainder];
//		}

		public static function divMod(pRemainder:Array, pX:int, pY:int):int {
			var d:int = div(pX, pY);
			pRemainder[0] = pX - pY * d;
			return d;
		}
	}
}
